package com.example.mapp;

import com.example.entity.Advertisement;
import com.example.entity.activity.Activity1;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import java.util.List;
import java.util.Map;

/**
 * Created by simon on 2018/12/18.
 */
@Mapper
public interface ActivityMapp {

    @Insert(" insert into activity1 (elevator_num,user_id,time,pic_url) value (#{elevatorNum},#{userId},#{time},#{picUrl})")
    @SelectKey(statement = "select last_insert_id()", keyProperty = "id", keyColumn = "id", before = false, resultType = Long.class)
    int addActivity1(Activity1 activiti1) throws Exception;

    @Select(" select * from activity1 where elevator_num = #{elevatorNum} ")
    List<Activity1> queryActivity1(Activity1 activity1) throws Exception;
}
